home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / presto / prest1_0.lha / src / mips_lock.s < prev    next >
Text File  |  1991-12-11  |  502b  |  27 lines

  1. /*
  2.  * Part of an atomic test-and-set implementation for
  3.  * the atomicless MIPS architecture. The other part
  4.  * of this is in scheduler_sig.c, where signals
  5.  * that are delivered in the middle of this code
  6.  * will cause it to restart.
  7.  *
  8.  * From the original by Raj Vaswani.
  9.  */
  10.  
  11. #include <mips/asm.h>
  12. #include <mips/regdef.h>
  13.  
  14.     .align 4
  15.     .set    noreorder
  16. LEAF(atomic_test_and_set)
  17.     lw    v0, 0(a0)
  18.     li    t1, 1
  19.     j     ra
  20.     sw    t1, 0(a0)
  21. EXPORT(atomic_test_and_set_rcs)
  22.     END(atomic_test_and_set)
  23.     .set     reorder
  24.     
  25.  
  26.     
  27.